#############################################################################
# Copyright (c) 2009 Dmitry Grushin <dgrushin@gmail.com>.
#
# This file is part of clupower (cluster power manager utility)
#
# Clupower is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Clupower is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Clupower.  If not, see <http://www.gnu.org/licenses/>.
#
# Contributors:
#    Dmitry Grushin <dgrushin@gmail.com> - initial API and implementation
#############################################################################

$:.unshift File.join(File.dirname(__FILE__),'..','lib')

require 'test'

class TestCPTest < Test::Unit::TestCase

  def setup
    $settings_path = File.dirname(__FILE__)
    $settings_file = "settings.test2.yaml"

    Settings.instance.load
  end

  def test_cptest
    puts "------- TEST1 --------------"
    CPTest.new.test
  end

  def test_cptest_error_handling
    Settings.instance.config["CMD_PBSNODES"] = "test/dumps/pbsnodes.empty"
    puts "------- TEST2 --------------"
    CPTest.new.test
  end

  def test2_cptest_error_handling
    Settings.instance.config["CMD_SSH"] = "fhaskfhakahg"
    puts "------- TEST3 --------------"
    CPTest.new.test
  end
end
